import javax.microedition.lcdui.*;

public class Register extends Form implements CommandListener, ItemCommandListener {

private TextField username = new TextField("Tai khoan: ", "", 20, TextField.ANY);
private TextField pass = new TextField("Mat khau: ", null, 20, TextField.PASSWORD);
private TextField pass2 = new TextField("Nhap lai mat khau: ", null, 20, TextField.PASSWORD);
private Command ok = new Command("Chon", Command.ITEM, 0);
private Command cancel = new Command("Tro lai", Command.BACK, 0);
private StringItem item = new  StringItem(null, "Dang ki", Item.BUTTON);






public Register() {
super("Dang ki thanh vien");
this.append(username);
this.append(pass);
this.append(pass2);
this.addCommand(ok);
this.addCommand(cancel);
this.setCommandListener(this);
item.setDefaultCommand(ok);
item.setItemCommandListener(this);
this.append(item);


}

public void commandAction(Command c, Displayable d) {


if (c == cancel) {
    
    SetDisplay.setCurrent(SetDisplay.SIGNIN);

}
}

    public void commandAction(Command c, Item item) {
       if (c == ok) {
                SetDisplay.setCurrent(SetDisplay.FRIENDSLIST);
}
    }
}